<?php

namespace api\modules\v1\controllers;

use common\models\searches\ArchiveDiarySearch;
use yii\rest\ActiveController;

/**
 * DiaryController implements the CRUD actions for ArchiveDiary model.
 */
class DiaryController extends ActiveController
{
	public $modelClass = 'common\models\ArchiveDiary';

	public function actions()
	{
		return array_merge_recursive(parent::actions(),[
			'index' => [
				'prepareDataProvider' => function($action) {
					$model = new ArchiveDiarySearch();
					return $model->search(\Yii::$app->request->getQueryParams());
				}
			]
		]);
	}
}
